package com.lzy.liujing.restaurant.controller.clientController;

import com.lzy.liujing.restaurant.entity.*;
import com.lzy.liujing.restaurant.service.DeskService;
import com.lzy.liujing.restaurant.service.GoodsCategoryService;
import com.lzy.liujing.restaurant.service.GoodsService;
import com.lzy.liujing.restaurant.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpSession;


@RestController
@CrossOrigin
@RequestMapping("/guest")
public class ClientDeskController{

    @Autowired
    private DeskService deskService;


    @GetMapping("/desk/{id}")
    public Result getOne(@PathVariable String id) {
        Desk byId = deskService.getByCode(id);
        if (byId == null) {
            return Result.fail(404, "查询不到该数据");
        }
        Result result = new Result(byId, "查询成功");
        return result;
    }
}
